import React from 'react'
import { Redirect } from 'react-router-dom'

const Home = React.lazy(() => import('@/pages/home'))
const Profile = React.lazy(() => import('@/pages/profile'))
const ShoppingCart = React.lazy(() => import('@/pages/shopping-cart'))
const Category = React.lazy(() => import('@/pages/category'))

const routes = [
  {
    path: '/',
    exact: true,
    render: () => <Redirect to="/home" />,
  },
  {
    path: '/home',
    component: Home,
  },
  {
    path: '/profile',
    component: Profile,
  },
  {
    path: '/shopping-cart',
    component: ShoppingCart,
  },
  {
    path: '/category',
    component: Category,
  },
  {
    render: () => <div>404</div>,
  },
]

export default routes
